package com.longlong.yfbank.utils;

import com.longlong.yfbank.entity.vo.ResponseVo;

/**
 * @author longlong
 * @date 2024-01-06 14:58
 * description
 */

public class ResponseUtil {
    public static <T>ResponseVo<T> success(T data){
        return new ResponseVo<>(200,"success",data);
    }

    public static <T>ResponseVo<T> error(int code,String msg){
        return new ResponseVo<>(code,msg,null);
    }

    public static <T>ResponseVo<T> error(T data) {
        return new ResponseVo<>(500,"error",data);
    }

    public static <T>ResponseVo<T> error(String msg) {
        return new ResponseVo<>(500,msg,null);
    }
}
